package marvin.webapp.audio.displaybeans;

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.LinkedList;
import java.util.List;

import marvin.music.dto.Client;
import marvin.music.dto.PlayList;
import marvin.webapp.exception.MarvinException;

public class ClientDB {
	private String name = "";
	private boolean resumeVisible = false;
	private Client client;
	
	private List<File> playList;
	
	public ClientDB(Client client) {
		super();
		this.client = client;
		this.name = client.getName();
		playList = new LinkedList<File>();
		PlayList pList = client.getPlayList();
		if(pList != null){
			List<String> fPath = pList.getPlayList();
			for (String string : fPath) {
				playList.add(new File(string));
			}
		}
	}
	
	public String getName() {
		return name;
	}

	public int getSound() {
		return 0;
	}

	public void setSound(int sound) {
	}

	public void stream(File file) throws IOException, InterruptedException, MarvinException {
		//client.streamFile(file);		
	}
	
	public void stream(URI uri) throws IOException {
		//client.stream(uri);		
	}

	public Client getClient() {
		return client;
	}

	public boolean isResumeVisible() {
		return resumeVisible;
	}

	public void setResumeVisible(boolean resumeVisible) {
		this.resumeVisible = resumeVisible;
	}

	public List<File> getPlayList() {
		return playList;
	}

	public void streamPlayList() throws IOException, MarvinException {
		//client.streamPlayList();
	}
}
